#ifndef _COMMON_H
#define _COMMON_H

#include "math.h"
#include "..\math\vector.h"
#include "..\common\types.h"
#include "..\common\def.h"

/*=========================================
3 Channel Color
==========================================*/
struct EE_EXPORT Color3f
{
	static const Color3f COLOR_WHITE; 
	static const Color3f COLOR_BLACK; 
	float r, g, b; 
	
	Color3f(void) : r(0.0F), g(0.0F), b(0.0F)
	{	}
	Color3f(float *p) : r(p[0]), g(p[1]), b(p[2])
	{	}
	Color3f(float red,float green,float blue) : r(red), g(green), b(blue)
	{	}
	Color3f(unsigned int red,unsigned int green,unsigned int blue) : r(red / 255.0f), g(green / 255.0f), b(blue / 255.0f)
	{	}
	
	Color3f operator + (const Color3f &op) const; 
	Color3f operator += (const Color3f &op); 
	Color3f operator * (const float &op) const; 
	
	operator float		*(); 
	operator float		* () const; 
}; 

/*=========================================
4 Channel Color
==========================================*/
struct EE_EXPORT COLOR4F
{
public:
	float r, g, b, a; 

	static COLOR4F white; 
	static COLOR4F black; 

	COLOR4F(void) : r(0.0F), g(0.0F), b(0.0F), a(1.0F)
	{	}

	COLOR4F(float red, float green, float blue, float alpha) : r(red), g(green), b(blue), a(alpha)
	{	}

	COLOR4F operator = (const float* pColor); 

	operator float* () const
	{
		return (float*)this; 	
	}
	
	operator float* ()
	{
		return (float*)this; 	
	}
}; 

#endif